/*
 * @Author: 0x9DEFA478
 * @Date: 2023-02-22 20:01:39
 * @LastEditTime: 2023-03-08 19:47:35
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#ifndef __PinInfo_H_
#define __PinInfo_H_
#include <string>
#include <vector>

namespace PinAbstract{

class FunctionInfo;




class PinInfo{
  public:

    static bool SetFunctionIndex(PinInfo* pinInfo,int index);

    PinInfo(int index,std::string& name);
    ~PinInfo();

    int Index(){
      return index;
    }

    const std::string& Name()const{
      return name;
    }
    std::string Name(){
      return name;
    }

    int FunctionCount(){
      return (int)functionObjects.size();
    }

    int FunctionIndex(){
      return functionSelectIndex;
    }
    
    virtual void SetFunctionIndex(int Index);

    FunctionInfo* GetFunctionByIndex(int index);

    void SetFunctionObjects(std::vector<FunctionInfo*>& FunctionObjects){functionObjects=FunctionObjects;}
    void SetFunctionObjects(std::vector<FunctionInfo*> FunctionObjects){functionObjects=FunctionObjects;}


  private:
    int index;//引脚索引
    std::string name;//引脚名
    int functionSelectIndex;//功能
    std::vector<FunctionInfo*> functionObjects;//功能对象
};




}

#endif //__PinInfo_H_
